import { ArrayNotEmpty, IsArray, IsNotEmpty, Length } from "class-validator";
import BaseEntity from "./BaseEntity";
import { Type } from "class-transformer";
import { IAnswers } from "./constraints";
export default class StudentPaperEntity extends BaseEntity {

  @IsNotEmpty({ message: '试卷不能为空' })
  public 'test_paper_id': string

  @IsNotEmpty({ message: '用户不能为空' })
  public 'account_id': string

  // @IsNotEmpty({ message: '试卷标识不能为空' })
  // @Length(1, 40)
  public 'id': string

  @Type(() => Object)
  @ArrayNotEmpty()
  @IsArray()
  public 'answers': IAnswers[]

  @Length(0, 255)
  public 'desc': string
}